(c-set-offset): Don't find a default syntactic element through
authorMartin Stjernholm <mast@lysator.liu.se>
Mon, 10 Feb 2003 00:50:26 +0000 (00:50 +0000)
committerMartin Stjernholm <mast@lysator.liu.se>
Mon, 10 Feb 2003 00:50:26 +0000 (00:50 +0000)
syntactic analysis if called outside a CC Mode buffer.

lisp/progmodes/cc-styles.el

index 4bd72f290703d4c8c2d4467b450dbc6b84beaae0..c7f1adaa4348bbef226ed7cc311357d5bf532016 100644 (file)
@@ -445,10 +445,11 @@ and exists only for compatibility reasons."
                    ;; initial contents tries to be the last element
                    ;; on the syntactic analysis list for the current
                    ;; line
-                   (let* ((syntax (c-guess-basic-syntax))
-                          (len (length syntax))
-                          (ic (format "%s" (car (nth (1- len) syntax)))))
-                     (cons ic 0))
+                   (and c-buffer-is-cc-mode
+                        (let* ((syntax (c-guess-basic-syntax))
+                               (len (length syntax))
+                               (ic (format "%s" (car (nth (1- len) syntax)))))
+                          (cons ic 0)))
                    )))
          (offset (c-read-offset langelem)))
      (list langelem offset current-prefix-arg)))